package homeworke.question18;

/**
 * Author：毕龙
 * Date: 2024/4/18 19:41
 */
public class SavingAccount extends Account {
    private double interestRate;

    public double getInterestRate() {
        return interestRate;
    }

    public void setInterestRate(double interestRate) {
        if(interestRate >0 && interestRate < 0.1){
            this.interestRate = interestRate;
        }
    }

    public SavingAccount() {
    }

    public SavingAccount(long id, String password) {
        super(id, password);
    }

    @Override
    public String toString() {
        return "SavingAccount{" +
                super.toString()+
                "interestRate=" + interestRate +
                '}';
    }
}
